Public Class Fibonacci

  Public Function GetSeqNumber (fibIndex As Integer) As Integer

   If (fibIndex < 2) Then
     Return fibIndex
   End If

   Dim FibArray(2) As Integer
   Dim i As Integer

   FibArray(0) = 0
   FibArray(1) = 1

   For i = 2 To fibIndex
     FibArray(1) = FibArray(1) + FibArray(0)
     FibArray(0) = FibArray(1) - FibArray(0)
   Next

   Return FibArray(1)
  End Function
End Class
